home *** CD-ROM | disk | FTP | other *** search
/ Level 2005 Christmas (DVD) / Level_2005-XMAS_134_DVD_Knightshift.iso / Demos / Ski Racing 2006 / setup1.cab / DataCommonShadersGhostSkinned.NSF < prev    next >
Encoding:
Text File  |  2005-11-03  |  4.1 KB  |  120 lines

  1. // Skinned ghost shader, just a simple additive environment mapping
  2.  
  3. NSFShader GhostSkinned
  4. {
  5.     // Packing Definition, wonder if i should change this since we dont use all the info but im afraid a separate
  6.     // vertexbuffer will be allocated for the mesh then
  7.     PackingDef PosBlendWeightBlendIndicesNormUV0
  8.     {
  9.         PD_Stream    0
  10.             PDP_Position        0    PDT_Float3
  11.             PDP_BlendWeights    1    PDT_Float3
  12.             PDP_BlendIndices    2    PDT_UByteColor
  13.             PDP_Normal          3    PDT_Float3
  14.             PDP_Binormal        4    PDT_Float3
  15.             PDP_Tangent         5    PDT_Float3
  16.             PDP_TexCoord0       7    PDT_Float2
  17.     }
  18.     
  19.     // Implementation
  20.     Implementation VS11_PS11
  21.     {
  22.         "This implementation is intended for hardware 
  23.          that supports vertex shader version 1.1 and
  24.          pixel shader 1.1."
  25.         
  26.         // Requirements for this implementation
  27.         Requirements
  28.         {
  29.             VSVersion               = v1.1
  30.             UserVersion             = v0.0
  31.             PSVersion               = v1.1
  32.             BinormalTangentMethod   = NBTMethod_ATI
  33.             BonesPerPartition       = 28
  34.             UsesNIRenderState       = true
  35.             Platform                = DX8|DX9|XBOX
  36.         }
  37.         
  38.         // Packing Definition it uses
  39.         PackingDef    PosBlendWeightBlendIndicesNormUV0
  40.  
  41.         //'Global' render states.  Nothing fancy here.  We set up Z for
  42.         //safety. 
  43.         RenderStates
  44.         {
  45.             AlphaBlendEnable    = true
  46.             SrcBlend            = one
  47.             DestBlend           = SrcAlpha
  48.  
  49.         //SrcBlend            = One
  50.             //DestBlend            = One
  51.             AlphaTestEnable     = false
  52.             CullMode            = CW
  53.             ZEnable             = ZB_True
  54.             ZWriteEnable        = false
  55.             ZFunc               = LessEqual
  56.             Lighting            = false   Save
  57.         }
  58.  
  59.         // First pass
  60.         Pass Pass0
  61.         {
  62.             // Vertexshader
  63.             VSProgram    "GhostSkinned"
  64.  
  65.             //Vertex Shader constant map.  Mostly commented in the vsh file.
  66.             //For double coverage, we'll state here that we could just use
  67.             //ViewProjTranspose since the SkinWorld part is usually identity,
  68.             //but if our assumption fails then at least positions will be 
  69.             //correct on screen.  Lighting and the warp effect will be off.
  70.             VS_Constantmap
  71.             {
  72.                 CM_Defined      SkinWorldViewProjTranspose  0    0
  73.                 CM_Constant     const_1_1_1_255             4    1   1.0,1.0,1.0,765.01
  74.                 CM_Constant     Half                        5    1   0.5,0.5,0.5,0.5                
  75.                 CM_Constant     Zero                        6    1   0.0,0.0,0.0,0.0
  76.                 CM_Defined      WorldViewTranspose            7    4
  77.                 CM_Defined      BoneMatrix3                 11   0   28
  78.             }
  79.             
  80.             // Texture stage 0
  81.             Stage 0    Stage0
  82.             {
  83.                 TSS_Texture        = NTM_Base
  84.             }
  85.  
  86.             //Stage 2    GlossMap
  87.             //{
  88.             //    TSS_Texture     = NTM_Gloss
  89.             //}
  90.  
  91.             
  92.             // Sampler stage 0
  93.             Sampler    0    BaseMapSampler
  94.             {
  95.                 TSAMP_AddressU    = TADDR_Clamp
  96.                 TSAMP_AddressV    = TADDR_Clamp
  97.                 TSAMP_AddressW    = TADDR_Clamp
  98.                 TSAMP_MagFilter    = TEXF_Linear
  99.                 TSAMP_MinFilter    = TEXF_Linear
  100.                 TSAMP_MipFilter    = TEXF_Linear
  101.             }
  102.         
  103.             // Sampler stage 1
  104.             //Sampler    1    GlossMapSampler
  105.             //{
  106.             //    TSAMP_AddressU    = TADDR_Clamp
  107.             //    TSAMP_AddressV    = TADDR_Clamp
  108.             //    TSAMP_AddressW    = TADDR_Clamp
  109.             //    TSAMP_MagFilter    = TEXF_Linear
  110.             //    TSAMP_MinFilter    = TEXF_Linear
  111.             //    TSAMP_MipFilter    = TEXF_Linear
  112.             //}
  113.         
  114.             // Pixelshader
  115.             PSProgram "GhostSkinned"
  116.         }
  117.     }
  118. }
  119.  
  120.